package com.sskj.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sskj.common.dto.InputParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "物模型模板")
@Data
@TableName("thing_model_template")
public class ThingModelTemplate {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "唯一标识符")
    @NotBlank(message = "唯一标识符不能为空")
    private String identifier;

    @Schema(description = "名称")
    @NotBlank(message = "名称不能为空")
    private String name;

    @Schema(description = "模型类型[1:属性|2:服务|3:类型]")
    @NotBlank(message = "类型不能为空")
    private Integer type;

    private String description;

    @Schema(description = "属性单位")
    @TableField("prop_unit")
    private String propUnit;

    @Schema(description = "属性数据类型")
    @TableField("prop_data_type")
    private Integer propDataType;

    @Schema(description = "服务输入参数集合")
    @TableField("service_input_params")
    private List<InputParam> serviceInputParams;

    @Schema(description = "事件数据")
    @TableField("event_output_params")
    private String event_output_params;

    @Schema(description = "事件级别")
    @TableField("event_level")
    private Integer eventLevel;

    @Schema(description = "状态[0:禁用|1:启用]")
    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
